﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using FluentUnity.Tests.Dependencies;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FluentUnity.Tests
{
    [TestClass]
    public class UniteFluentlyTests
    {
        [TestMethod]
        public void Default()
        {
            var container = new UnityContainer();
            container.UniteFluently(GetType().Assembly);
            container.LoadConfiguration("overridden");

            var thing = container.Resolve<ISomeThing>();
            Assert.IsNotNull(thing);
            Assert.IsInstanceOfType(thing, typeof(SomeThing));
            Assert.IsNotNull(thing.SomeOtherThing);
            Assert.IsInstanceOfType(thing.SomeOtherThing, typeof(SomeAlternateThing));
            thing.DoSomething();
        }

    }
}
